/**
 * reduces: 不管逻辑，只管计算
 */
import {INCREMENT,DECREMENT} from '../constant';

export default function countReducer(preState = 0, state) {
  const { type, data } = state;
  // console.log(preState, state);
  switch (type) {
    case INCREMENT:
      console.log(preState)
      return preState + data;
    case DECREMENT:
      return preState - data;
    default:
      return preState
  }
}
